package com.yp.lession.redisqf211.util;

/**
 * @author: COS
 * @time: 2022/3/25 11:30
 * @description:
 */
public class StringUtils {

    /**
     *
     * @author: COS
     * @return:
     * @time: 2022/3/25 11:31
     * @description: 字符串转int
     */
    public static Integer stringToInteger(String num){
        try {
            return num==null?1:Integer.valueOf(num);
        } catch (NumberFormatException e) {
            //e.printStackTrace();
            //如果出现异常就返回1
            return 1;
        }
    }
    /**
     *
     * @author: COS
     * @return:
     * @time: 2022/3/25 11:34
     * @description: 判断字符串是否为null
     */
    public static boolean isNotEmpty(String... strs){
        for (String str : strs) {
            if (str==null||str.trim().length()==0) {
                return false;
            }
        }
        return true;
    }

}
